# -*- coding: utf-8 -*-
# @Author: Cursor
# @Date: 2025-01-08
# @Last Modified by: Tim Liu
# @Last Modified time: 2025-01-08

# @Description: Ontology pydantic

from pydantic import BaseModel, ConfigDict
# from sqlalchemy import Integer, ForeignKey
# from sqlalchemy.orm import Mapped, mapped_column

from core.data_types import DatetimeStr
from apps.vadmin.auth.schemas import UserSimpleOut

class Ontology(BaseModel):
    name: str
    description: str | None = None
    create_user_id: int | None = None

class OntologySimpleOut(Ontology):
    model_config = ConfigDict(from_attributes=True)

    id: int
    update_datetime: DatetimeStr
    create_datetime: DatetimeStr

class OntologyFullOut(OntologySimpleOut):
    model_config = ConfigDict(from_attributes=True)
    
    create_user: UserSimpleOut
    schemas: list["OSchema"]  # Use forward reference for OSchema

# Deferred import to avoid circular dependency
from .oschema import OSchema